#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime

from pydantic import BaseModel
from typing import Optional, TypeVar, Generic, Union

from pydantic.generics import GenericModel

from app.db.base_class import Base

RT = TypeVar("RT", bound=Union[BaseModel, Base, int, float, datetime, bool])

class ResponseResult(GenericModel, Generic[RT]):
    code: str
    msg: str
    data: Optional[RT]

    class Config:
        arbitrary_types_allowed = True